#include <gtest/gtest.h>

extern void getSum(int& sum);

struct Test5 : ::testing::Test
{
    static void throw_err(int)
    {
        throw std::exception();
    }

    virtual void SetUp() override
    {
#ifndef WIN32
        signal(SIGSEGV, throw_err);
#endif
    }
};

TEST_F(Test5, should_get_sum_to_100)
{
    int sum = 0;
    for(int i = 0;i<100; i++)
    {
        ASSERT_NO_THROW(getSum(sum));
    }
    ASSERT_TRUE(sum > 0) ;
}
